<?php
PageUtil::addVar("stylesheet","<link href=\"".$stylepath."/type.css\" rel=\"stylesheet\">");
?>
<div class="content_block col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<h2>จัดการชนิด <a style="float:right;" href="<?php echo base_url('admin/type/add'); ?>" class="btn btn-primary"> Add </a></h2>
		
	<?php
	 	if(!empty($types)){
	 	?>	
	<table class="table table-hover">
	 		<thead>
				<tr>
					<th>รหัส</th>
					<th>รายการ</th>
					<th>สำหรับ Admin</th>
					<th>Edit & Del</th>
				</tr>
			</thead>
			<tbody >
	<?php foreach($types as $type) : ?> 
     <!--ส่วปิด if  -->
				<tr>
					<td  class="span2"><?php echo $type['id']; ?></td>
					<td><?php echo $type['name']; ?></td>
					<td><?php echo ($type['admin'] == 1)?'Yes':'No'; ?></td>
					<!--<td><input type="text" name="order" value="0"></td>-->
					<td class="span2">
	          <a href="<?php echo base_url('admin/type/add/'.$type ['id']);?>" class="btn btn-success">Edit</a>
	          <a href="<?php echo base_url('admin/type/delete/'.$type ['id']);?>" onClick="return confirm('คุณมั่นใจว่าจะลบ?');" class="btn btn-danger">Delete</a>
					</td>
				</tr>
	<?php endforeach; ?>
				</tbody>
			</table>
			<?php
		}else{
		?>
			<div class="item-list">
        <h4 class="text-center">ยังไม่มีข้อมูล</h4>
      </div>
		<?php
		} // End if
		?>
</div>